- blame = local_assigns.fetch(:blame, false)
.nav-block
  .tree-ref-container

    %ul.breadcrumb.repo-breadcrumb
      %li.breadcrumb-item
        = link_to project_tree_path(@project, @ref, ref_type: @ref_type) do
          = @project.path
      - path_breadcrumbs do |title, path|
        - title = truncate(title, length: 40)
        %li.breadcrumb-item
          - if path == @path
            = link_to project_blob_path(@project, tree_join(@ref, path), ref_type: @ref_type) do
              %strong= title
          - else
            = link_to title, project_tree_path(@project, tree_join(@ref, path), ref_type: @ref_type)

  .tree-controls.gl-flex.gl-flex-wrap.gl-items-baseline.gl-gap-3{ class: '@sm/panel:gl-flex-nowrap' }
    = render 'projects/find_file_link'
    -# only show normal/blame view links for text files
    - if blob.readable_text?
      - if blame
        = link_button_to _('Normal view'), project_blob_path(@project, @id, ref_type: @ref_type)
      - else
        = link_button_to _('Blame'), project_blame_path(@project, @id, ref_type: @ref_type), data: { event_tracking: 'click_blame_control_on_blob_page' }, class: 'js-blob-blame-link' unless blob.empty?

    - permalink_description = _('Go to permalink')
    - permalink_shortcut = 'y'
    - permalink_title = "#{permalink_description} <kbd class='flat !gl-ml-2' aria-hidden=true>#{permalink_shortcut}</kbd>"
    = link_button_to _('Permalink'), project_blob_path(@project, tree_join(@commit.sha, @path)),
        'aria-keyshortcuts': permalink_shortcut,
        class: 'has-tooltip js-data-file-blob-permalink-url',
        'data-html': true,
        title: permalink_title
